package com.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangzhenjun
 * @date 2023/10/31 14:40
 */
@Slf4j
@RequestMapping("/message")
@RestController
public class MessageController {


    @GetMapping(value = "/sendMessage/{userId}")
    public String sendMessage(@PathVariable(value = "userId") Integer userId) {
        log.info("====>短信模块<========");
        if (userId < 1 || userId > 999999) {
            throw new RuntimeException("用户不存在，请重新请求！");
        }
        return "发送短信成功！";
    }
}
